#include "common.h"
int set_nonblock(int fd)
{
	int flags;
	if ((flags = fcntl(fd, F_GETFL, 0)) < 0 ||
		fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0)
	{
		perror("setting O_NONBLOCK");
		return -1;
	}
	return 0;
}


